#pragma once
#include <opencv2/opencv.hpp>
#include <string>
#include <memory>
#include <mutex>
#include <iostream>
#include <fstream> // 文件流库

class DataStorer {
public:
    DataStorer() = default;
    ~DataStorer() = default;

    static DataStorer& instance();
    std::ofstream itsFile;

    void open();
    void write(float value);
    void write(float Progress, float value);
    void close();

private:

    static std::unique_ptr<DataStorer> dataStorer;
    static std::once_flag              itsOnceFlag;
};
